NumericText and IsNumeric (str) are equivalent functions. However, NumericText is preferred in Crystal syntax, whereas IsNumeric is preferred in Basic syntax.
str is a text string being tested for numeric text.
NumericText tests to see if the content of a text object is a Number.
If you store numbers (like weight) in a text object, use NumericText to check the value of each record to make sure it is OK to convert using ToNumber (numeric), ToNumber (string), ToNumber (Boolean).
The following examples are applicable to both Basic and Crystal syntax, although IsNumeric is preferred in the latter:
Returns FALSE where {file.REFERENCE} = "ABCDEFG".
Returns TRUE where {file.IDNUM} = "12345".
Returns TRUE where {file.IDNUM} = "12345443".
Returns FALSE where {file.IDNUM} = "12345
NumericText ({file.IDNUM} [1 to 5])
Returns TRUE where {file.IDNUM} = "12345
NumericText ({file.IDNUM} [6])
Returns FALSE where {file.IDNUM} = "12345
NumericText ({file.IDNUM} [7 to 9])
Returns TRUE where {file.IDNUM} = "12345
Returns FALSE where {file.IDNUM} = "12345T".
Note: You can use this function in combination with ToNumber (numeric), ToNumber (string), ToNumber (Boolean) to test for a Number in the Reference field, then print the string as a Number or print 0 if the text string is not a Number.
The following example is applicable to Crystal syntax:
If NumericText({file.REFERENCE}) Then
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |